# Author: Yubin Lim(purewell@gmail.com)
# Date: 2008-01-18
# License: BSD License
# Copyright: All rights reserved by Yubin Lim.

add_definitions(-D_FILE_OFFSET_BITS=64)
add_definitions(-D_LARGEFILE_SOURCE)
add_definitions(-D_LARGE_FILES)
#add_definitions(-D_POSIX_)
add_definitions(-D__PW_EXPORT)

include_directories("${PROJECT_SOURCE_DIR}/include")

file(GLOB SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
file(GLOB LHDRS "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
file(GLOB HDRS "${PROJECT_SOURCE_DIR}/include/purewell/*.hpp")

add_library(purewell ${SRCS} ${HDRS} ${LHDRS})

if (WIN32)
	target_link_libraries(purewell "ws2_32.lib")
endif (WIN32)

set_target_properties(purewell
	PROPERTIES SOVERSION "${PROJECT_VERSION}"
	VERSION "${PROJECT_VERSION}")

add_subdirectory(code)

install(TARGETS purewell
	RUNTIME DESTINATION bin
	LIBRARY DESTINATION ${LIBDIRNAME}
	ARCHIVE DESTINATION ${LIBDIRNAME})
